package com.sphd.emanu.activity.todaysale;

import com.sphd.emanu.mvp.BasePresenterImpl;
import com.sphd.emanu.pojo.DaySale;
import com.sphd.emanu.utils.GsonUtil;
import com.wzutils.L;

import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;

/**
 * MVPPlugin
 *  邮箱 784787081@qq.com
 */

public class TodaysalePresenter extends BasePresenterImpl<TodaysaleContract.View> implements TodaysaleContract.Presenter{

    @Override
    public void saleDaySum(Integer org, String date) {
        emanuService.saleDaySum(org, date).enqueue(new Callback<String>() {
            @Override
            public void onResponse(Call<String> call, Response<String> response) {
                L.e(response.toString());
                mView.recBean(GsonUtil.GsonToBean(response.body(), DaySale.class));
            }

            @Override
            public void onFailure(Call<String> call, Throwable t) {
                Error(t);
            }
        });
    }
}
